package controllers

import (
	"lottery_code/models"
	"lottery_code/services"
	"time"
)

func (api *LuckyApi)checkBlackip(ip string)(bool,*models.LtBlackip){
	blackService:=services.NewBlackipService()
	infoData:=blackService.GetByIp(ip)
	if infoData==nil||infoData.Ip==""{
		return true,nil
	}
	if infoData.Blacktime>int(time.Now().Unix()){
		return false,infoData
	}
	return true,infoData
}